import Vue from "vue";
import Router from "vue-router";
import Login from "@/views/login/Login.vue";
import Home from "@/views/Home.vue";
import Area from "@/views/dor/Area.vue";
import DormInfo from "@/views/dor/DormInfo";
import RoomInitialize from "@/views/dor/RoomInitialize";
import RoomInfo from "@/views/dor/RoomInfo";
import BerthInfo from "@/views/dor/BerthInfo";
import OutRoom from "@/views/inout/OutRoom";
import InRoom from "@/views/inout/InRoom";
import InoutRecord from "@/views/inout/InoutRecord";
import FreeCost from "@/views/cost/FreeCost";
import OutCost from "@/views/cost/OutCost";
import CostDetail from "@/views/cost/CostDetail";
import MonthCost from "@/views/cost/MonthCost";
import RoomGoodsInitialize from "@/views/goods/RoomGoodsInitialize";
import UseGoods from "@/views/goods/UseGoods";
import RoomGoods from "@/views/goods/RoomGoods";

// import
Vue.use(Router);

export default new Router({
  routes: [{
      path: "/",
      redirect: "/login",
      hidden: true
    },
    {
      path: "/login",
      name: "Login",
      component: Login,
      hidden: true
    },
    {
      path: "/home",
      name: "宿舍楼管理",
      component: Home,
      iconCls: "", //图标样式class
      children: [{
          path: "/area",
          component: Area,
          name: "区域管理"
        },
        {
          path: "/dormInfo",
          component: DormInfo,
          name: "宿舍楼信息管理"
        },
        {
          path: "/roomInitialize",
          component: RoomInitialize,
          name: "房间信息初始化"
        },
        {
          path: "/roomInfo",
          component: RoomInfo,
          name: "房间管理"
        },
        {
          path: "/berthInfo",
          component: BerthInfo,
          name: "床位管理"
        }
      ]
    },
    {
      path: "/home",
      name: "入住/退宿",
      component: Home,
      iconCls: "", //图标样式class
      children: [{
          path: "/inRoom",
          component: InRoom,
          name: "入住"
        },
        {
          path: "/outRoom",
          component: OutRoom,
          name: "退宿"
        },
        {
          path: "/inoutRecord",
          component: InoutRecord,
          name: "入住/退宿记录查询"
        }
      ]
    },
    {
      path: "/home",
      name: "费用管理",
      component: Home,
      iconCls: "", //图标样式class
      children: [{
          path: "/freeCost",
          component: FreeCost,
          name: "免扣水电申请" // 申请单录入、查询、销假单录入、查询同一个界面
        },
        {
          path: "/costDetail",
          component: CostDetail,
          name: "水电费查询"
        },
        {
          path: "/outCost",
          component: OutCost,
          name: "退宿费用结算"
        },
        {
          path: "/monthCost",
          component: MonthCost,
          name: "月底结算"
        }
      ]
    },
    {
      path: "/home",
      name: "物品管理",
      component: Home,
      iconCls: "",
      children: [{
          path: "/roomGoodsInitialize",
          component: RoomGoodsInitialize,
          name: "房间资产初始化"
        },
        {
          path: "/useGoods",
          component: UseGoods,
          name: "领用物品管理"
        },
        {
          path: "/roomGoods",
          component: RoomGoods,
          name: "房间物品管理"
        }
      ]
    }
  ]
});
